{% extends '__base__.html' %}

{% block title %}首页{% endblock %}

{% block content %}
    <div class="container">
        <div class="row">
            <div class="col-md-8 pb-4">
                {% for blog in blogs %}
                <div class="card mb-4">
                    <div class="card-header">
                        publish by {{ blog.user_name }} <sub> at {{ blog.updated_at|datetime }}</sub>
                    </div>
                    <div class="card-body">
                        <h5 class="card-title">{{ blog.name }}</h5>
                        <p class="card-text">{{ blog.summary }}</p>
                    </div>
                </div>
                {% endfor %}
            </div>
            <aside class="col-md-4 blog-sidebar">
                <div class="p-4 mb-3 bg-light rounded">
                    <h4 class="font-italic">用户信息</h4>
                    {% if __user__ %}
                    <p class="mb-0">{{ __user__.name }}</p>
                    <p class="mb-0">{{ __user__.email }}</p>
                    {% else %}
                    <p class="mb-0">用户未登录</p>
                    {% endif %}
                  </div>
            </aside>
        </div>
    </div>
{% endblock %}
